package net.area80.composer.form
{
	import flash.display.DisplayObject;
	
	import net.area80.composer.core.Composer;
	import net.area80.validate.Validator;
	
	public class FormComposer extends Composer
	{
		protected var _validator:Validator;
		public function FormComposer(initObject:DisplayObject, validator:Validator=null)
		{
			_validator = (!validator) ? new Validator() : validator;
			super(initObject);
		}
		public function get value ():* {
			return null;
		}

		public function validate ():Boolean {
			return _validator.isValid(value);
		}
		public function getErrorMessage ():String {
			return _validator.errorMessage;
		}
		
	}
}